//reducer
export function counter(state=0, action){
    switch (action.type){
        case '+':
            return state + 1
        case '-':
            return state - 1
        default:
            return 0
    }
}

export function add(){
    return {type: '+'}
}

export function remove(){
    return {type: '-'}
}

export function addAsync(){
    return dispatch => {
        setTimeout(() => {
            dispatch(add())
        },1000)
    }
}
